package com.yunqing.restkeeper.enterprise.web.controller.store;

import com.yunqing.restkeeper.store.api.entity.TableArea;
import com.yunqing.restkeeper.store.api.service.ITableAreaService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName TableController
 * @Description TODO
 * @author: puyunqing
 * @Date: 2025/8/12
 */

@Slf4j
@Tag(name = "区域管理")
@RestController
@RequestMapping("/table")
public class TableController {

    @DubboReference(version = "1.0.0",check = false)
    private ITableAreaService tableAreaService;

    @Operation(summary = "添加区域")
    @PostMapping("/addArea")
    public boolean addArea(@RequestParam("name") String name){
        TableArea tableArea = new TableArea();
        tableArea.setAreaName(name);
        return tableAreaService.add(tableArea);
    }
}
